<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: ''
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="伽罗华（法国，1811～1832）才华横溢，可惜在21岁时早早死于情场决斗。他证明了：对于给定的一个素数次不可约方程能判断出它是否能根式求解。Bluetooth在bit streaming过程中计算Sync word，HEC，FEC及data whitening时使用到了伽罗华域中的计算规则来处理比特流，本文就收集到的信息做个总结。 一个元素个数有限的域称为有限域，或者伽罗华域(Galoisfie">
<meta name="keywords" content="Bluetooth">
<meta property="og:type" content="article">
<meta property="og:title" content="伽罗华域">
<meta property="og:url" content="http://yoursite.com/2019/10/02/glois-theory/index.html">
<meta property="og:site_name" content="Wen Wu&#39;s notes">
<meta property="og:description" content="伽罗华（法国，1811～1832）才华横溢，可惜在21岁时早早死于情场决斗。他证明了：对于给定的一个素数次不可约方程能判断出它是否能根式求解。Bluetooth在bit streaming过程中计算Sync word，HEC，FEC及data whitening时使用到了伽罗华域中的计算规则来处理比特流，本文就收集到的信息做个总结。 一个元素个数有限的域称为有限域，或者伽罗华域(Galoisfie">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-10-02T09:24:49.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="伽罗华域">
<meta name="twitter:description" content="伽罗华（法国，1811～1832）才华横溢，可惜在21岁时早早死于情场决斗。他证明了：对于给定的一个素数次不可约方程能判断出它是否能根式求解。Bluetooth在bit streaming过程中计算Sync word，HEC，FEC及data whitening时使用到了伽罗华域中的计算规则来处理比特流，本文就收集到的信息做个总结。 一个元素个数有限的域称为有限域，或者伽罗华域(Galoisfie">





  
  
  <link rel="canonical" href="http://yoursite.com/2019/10/02/glois-theory/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>伽罗华域 | Wen Wu's notes</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Wen Wu's notes</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">technical record</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-schedule">

    
    
      
    

    

    <a href="/schedule/" rel="section"><i class="menu-item-icon fa fa-fw fa-calendar"></i> <br>日程表</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">

    
    
      
    

    

    <a href="/sitemap.xml" rel="section"><i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/10/02/glois-theory/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">伽罗华域

              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-10-02 17:24:49" itemprop="dateCreated datePublished" datetime="2019-10-02T17:24:49+08:00">2019-10-02</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Bluetooth/" itemprop="url" rel="index"><span itemprop="name">Bluetooth</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/10/02/glois-theory/" class="post-meta-item leancloud_visitors" data-flag-title="伽罗华域">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/10/02/glois-theory/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/10/02/glois-theory/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>伽罗华（法国，1811～1832）才华横溢，可惜在21岁时早早死于情场决斗。他证明了：对于给定的一个素数次不可约方程能判断出它是否能根式求解。<br>Bluetooth在bit streaming过程中计算Sync word，HEC，FEC及data whitening时使用到了伽罗华域中的计算规则来处理比特流，本文就收集到的信息做个总结。</p>
<p>一个元素个数有限的域称为<strong>有限域</strong>，或者<strong>伽罗华</strong>域(Galoisfield)</p>
<ol>
<li>有限域中元素的个数为一个素数，记为GF(p),其中p为素数;<blockquote>
<p>一个大于1的整数，如果它的正因数只有1和它本身，就叫做素数，否则就叫做合数</p>
</blockquote>
</li>
<li><p>有限域中运算满足<br>– 交换律:a+b = b+a, a·b = b·a<br>– 结合律:(a+b)+c = a+(b+c), a·(b·c) = (a·b)·c<br>– 和分配律:a·(b+c) = a·b+a·c</p>
<p>将GF(p)延伸为一个含有$p^m$个元素的域，称为GF(p)的扩展域，表示为GF($p^m$)，m是一个非零正整数。</p>
<blockquote>
<p>注意:GF(p)是GF($p^m$)的子集。</p>
</blockquote>
</li>
</ol>
<p>二进制域GF(2)是扩展域GF($2^m$)的一个子域，类似于实数域是复数域的一个子域一样。除了数字0和1之外，在扩展域中还有特殊的元素，用一个新的符号a表示。GF($2^m$)中任何非0元素都可由a的<strong>幂次</strong>表示。</p>
<p>有限元素的集合GF($2^m$)，只能含有$2^m$个元素，并且对乘法封闭，其约束条件为$a^{(2^m−1)}$+1=0<br>• 根据这个多项式限制条件，任何幂次等于或超过$2^m-1$的域元素都可降阶为下述幂次小于$2^m-1$的元素:</p>
<script type="math/tex; mode=display">a^{(2^m+n)} = a^{(2^m−1)}a^{(n+1)} = a^{(n+1)}</script><p>这样，GF($2^m$)的元素可表示为:</p>
<script type="math/tex; mode=display">GF(2^m) ={0,a^0,a^1,a^2,...,a^{2^m −2}}</script><p>扩展域$GF(2^m)$中的加法<br>• 在$GF(2^m)$中，将每个非0域元素用多项式$a_i(x)$表示，其系数至少有一个不为0。对于i=0,1, 2,…,$2^m-2$，有:</p>
<script type="math/tex; mode=display">a_i = a_i(x) = a_{i,0} + a_{i,1}x + a_{i,2}x^2+...+a_{i,m-1}x^{m-1}</script><p>• 先看m=3,有限域表示为$GF(2^3)$,下表为上式描述的基本元素(Primitive Element) ${x^0,x^1,x^2}$映射为7个元素{$a_i$}和一个0元素。表中的各行是二进制数字序列，代表上式中的系数$a_{i,0}、a_{i,1}、a_{i,2}$的取值。</p>
<div class="table-container">
<table>
<thead>
<tr>
<th>_</th>
<th style="text-align:center">$x^0$</th>
<th style="text-align:center">$x^1$</th>
<th style="text-align:center">$x^2$</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
</tr>
<tr>
<td>$a^0$</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
</tr>
<tr>
<td>$a^1$</td>
<td style="text-align:center">0</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
</tr>
<tr>
<td>$a^2$</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
<td style="text-align:center">1</td>
</tr>
<tr>
<td>$a^3$</td>
<td style="text-align:center">1</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
</tr>
<tr>
<td>$a^4$</td>
<td style="text-align:center">0</td>
<td style="text-align:center">1</td>
<td style="text-align:center">1</td>
</tr>
<tr>
<td>$a^5$</td>
<td style="text-align:center">1</td>
<td style="text-align:center">1</td>
<td style="text-align:center">1</td>
</tr>
<tr>
<td>$a^6$</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
<td style="text-align:center">1</td>
</tr>
<tr>
<td>$a^7$</td>
<td style="text-align:center">1</td>
<td style="text-align:center">0</td>
<td style="text-align:center">0</td>
</tr>
</tbody>
</table>
</div>
<p>多项式$f(x)=1+x+x^3$ 为GF($2^3$)的元素与基本元素之间的映射。</p>
<p>有限域中两个元素的<strong>加法</strong>定义为两个多项式中同幂次项系数 进行<strong>模2加</strong>，即<br>$a^i+a^j=(a_{i,0}+a_{j,0}) + (a_{i,1}+a_{j,1})x + … + (a_{i,m-1}+a_{j,m-1})x^{m-1}$<br>• 有限域的<strong>本原多项式</strong>。本原多项式定义了域GF($2^m$)， 一个多项式是本原多项式的充要条件:</p>
<blockquote>
<p>一个m阶的不可约多项 式f(x)，如果f(x)整除$x^n+1$的最小正整数n满足$n=2^m-1$，则该多项式是本原的。</p>
</blockquote>
<h3 id="关于多项式在伽罗华域的求根"><a href="#关于多项式在伽罗华域的求根" class="headerlink" title="关于多项式在伽罗华域的求根"></a>关于多项式在伽罗华域的求根</h3><p> 以$p(x) = 1 + x + x^3$ 为例，多项式的幂次为m=3,所以由p(x)所定义的域中包含了$2^m=2^3=8$个元素。求解p(x)的根就是指找到x 使p(x)=0。由高斯的基本代数学理论我们知道，对于幂次为m的多项式必然有m个根。对于这个例子，p(x)=0有3个根，由于这3个根不可能位于与p(x)系数相同的有限域中，而是位于扩展域GF($2^3$)中。<br>用扩展域的元素 a来定义多项式p(x)的根，可写成如下形式:p(a)=0<br>即 $1+a+a^3=0$，在该多项式两边都加上 1 + a, 就可以得到$a^3=1+a$ 这意味着$a^3$可以表示为更低阶a项的加权和。</p>
<p>类似地有:<br>$a^4$=a<em>$a^3$=a</em>(1+a)=a+$a^2$<br>$a^5$=a<em>$a^4$=a</em>(a+$a^2$)=$a^2$+$a^3$=1+a+$a^2$<br>$a^6$=a<em>$a^5$=a</em>(1+a+$a^2$)=a+$a^2$+$a^3$=1+$a^2$<br>$a^7$=a<em>$a^6$=a</em>(1+$a^2$)=a+$a^3$=1=$a^0$ </p>
<p>所以，有限域GF($2^3$)的8个元素为 ${0,a^0,a^1,a^2,a^3,a^4,a^5,a^6}$</p>
<p>这8个元素中哪些是p(x)=0的3个根呢?我们可通过枚举 找到!<br>p($a^0$)=1, $a^0$不是<br>p($a^1$)=1+a+$a^3$=0, $a^1$是<br>p($a^2$)=1+$a^2$+$a^6$=1+$a^0$=0, $a^2$是<br>p($a^3$)=1+$a^3$+$a^9$=1+$a^3$+$a^2$=1+$a^5$=$a^4$, $a^3$不是<br>p($a^4$)=1+$a^4$+$a^12$=1+$a^4$+$a^5$=1+$a^0$=0, $a^4$是<br>同理可计算p($a^5$)、p($a^6$)都不等于0，所以p(x)=1+x+$x^3$的 3个根是a, $a^2$, $a^4$</p>
<p>主要参考文献有<br><a href="https://cloud.tencent.com/developer/article/1005808">FEC的介绍</a></p>

      
    </div>

    

    
      
    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/Bluetooth/" rel="tag"># Bluetooth</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/08/26/存在主义咖啡馆/" rel="next" title="存在主义咖啡馆">
                <i class="fa fa-chevron-left"></i> 存在主义咖啡馆
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/10/02/LFSR/" rel="prev" title="LFSR">
                LFSR <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  
    
    <div class="comments" id="comments"></div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
  <p class="site-author-name" itemprop="name">Wen Wu</p>
  <div class="site-description motion-element" itemprop="description">I'm a bluetooth Host and Controller developer</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>













          
          
        </div>
      </div>

      
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#关于多项式在伽罗华域的求根"><span class="nav-number">1.</span> <span class="nav-text">关于多项式在伽罗华域的求根</span></a></li></ol></div>
            

          </div>
        </div>
      <!--/noindex-->
      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wen Wu</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>





  <script src="https://unpkg.com/mermaid@/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  
  

  
  

  
    
      <script type="text/x-mathjax-config">
  

  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$', '$'], ['\\(', '\\)'] ],
      processEscapes: true,
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      
      equationNumbers: {
        autoNumber: 'AMS'
      }
    }
  });

  MathJax.Hub.Register.StartupHook('TeX Jax Ready', function() {
    MathJax.InputJax.TeX.prefilterHooks.Add(function(data) {
      if (data.display) {
        var next = data.script.nextSibling;
        while (next && next.nodeName.toLowerCase() === '#text') {
          next = next.nextSibling;
        }
        if (next && next.nodeName.toLowerCase() === 'br') {
          next.parentNode.removeChild(next);
        }
      }
    });
  });

  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for (i = 0; i < all.length; i += 1) {
      element = document.getElementById(all[i].inputID + '-Frame').parentNode;
      if (element.nodeName.toLowerCase() == 'li') {
        element = element.parentNode;
      }
      element.classList.add('has-jax');
    }
  });
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>

    
  























<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'forest',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  
    

  

<script src="//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'wteo2C9GdG6F2N92cktVar8K-gzGzoHsz',
    appKey: 'IBKrtkUwlKqPJ8FQsKkNP0K1',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zh-cn' || 'zh-cn'
  });
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

  

</body>
</html>
